The TMI PolyMorph Control Help Document
This document describes the TMI PolyMorph Data Entry control, it’s methods, properties and events.
To install the PolyMorph control, copy the Polymorph.ocx and RegPoly.Bat files into your Windows System directory from the location you unzipped them to. Once you have done this, you will need to register the PolyMorph control in your system registry before you can use it. To do this, simply run the RegPoly.bat batch file by double clicking on it in the Windows explorer. If this has been completed successfully you will be able to use the PolyMorph control within Visual Basic by simply adding it in as you would any other standard component.
The remaining files contained in the Polymorph.Zip file are used by the Sample Program and may be placed anywhere on your machine. To open the Sample Program, double-click on the file SampleApp.Vbp. This will open the application in Visual Basic.
The PolyMorph control is a lightweight data entry control designed to help reduce the development efforts associated with data validation. In any application that can accept user input (especially database applications) a considerable amount of effort must be expended ensuring that the data a user enters is correct. In most cases, the level of data validation is low, requiring only cursory checks to make that the information is of the correct data type, such as a number or a date. However, it is often necessary to make sure that the data is ‘reasonable’. For example, it is unlikely that a person’s age would be greater than 120, or that the Expiry Date for a product is 01/12/1909. In this case, the data can be validated by applying acceptable ranges for the data (such as Age must be less than 120 but greater than 0). A more subtle validation is checking a finite list of correct data, such as a list of countries for the person’s Country of Origin or the name of a customer. This is often thought of as a LookUp value or List.
The PolyMorph control caters for these three types of validation, by simply applying properties. You can set the data type (text, date or one of several different number types – Integer, Whole Number, Double, Single, Currency and so on), Minimum and Maximum values and create lists of valid data. By setting the appropriate properties you can remove most of the tedious manual effort of data validation and greatly reduce your development efforts.
However, the PolyMorph control is not only applicable to data entry validation. It has a number of additional features to optimise your application development and simplify your work. There are some advanced user-interface elements to make the control easier to use, such as a pop-up calendar and calculator and text-highlights to alert the user when they have entered something that is incorrect. Also, when you bind the control to a datafield two new properties become available, SQL_Phrase and SQL_Value. These two properties return the correctly bracketed SQL value of the data entered (such as 123, "John Smith" or #01/01/1999# for numeric, text and date data types respectively) and a complete phrase (such as Customer_Name = "John Smith") that can be easily used to create SQL Select strings.
The control is flexible enough to be used in virtually any situation that you could use a standard textbox or combobox and is lightweight enough not to swallow your resources or application performance even in large and complex forms. We have tried hard to make it a control that you would like to use in every situation and we hope that it provides you with a trouble-free and comprehensive development experience.
The PolyMorph control uses many of the standard properties available in the standard Visual Basic controls. As such, only those properties that have special meanings to the PolyMorph control are described here.
The PolyMorph control uses only standard methods that are the same as those used in the standard TextBox or ComboBox controls in Visual Basic.
The Polymorph control has only standard events except for: